<?php
/**
 * PrynLib
 * @copyright 2007-2009 Prynel
 * @author Olivier ROGER <roger.olivier@gmail.com> $Author: oroger $
 * @package Config
 * @version $Revision: 107 $
 */
 
/**
 *
 * @category libPrynel
 * @version 1.1.0 
 * @author Olivier ROGER <roger.olivier@gmail.com>
 * @copyright  2007-2009 Prynel
 *       
 *
 */
define('MODE_CONFIG',"prod");
define('ROOT_LIB',dirname(__FILE__).DIRECTORY_SEPARATOR);
class Config
{
	private static $revision = '$Revision: 107 $';

	/**
	 * Retourne les informations de la base de données
	 *
	 * @return array
	 */
	public static function getBddinfo()
	{
		$config = Config_Ini::getInstance(ROOT_LIB.'config.ini',MODE_CONFIG);
		return $config->db;
	}
	
	/**
	 * Retourne le chemin de fileinfo
	 *
	 * @return string
	 */
	public static function getFinfo()
	{
		$config = Config_Ini::getInstance(ROOT_LIB.'config.ini',MODE_CONFIG);
		return $config->finfo;
	}
	
	/**
	 * Retourne la revision du framework
	 *
	 * @return string
	 */
	public static function getRevision()
	{
		return self::$revision;
	}
	
	/**
	 * Inscrit l'autoload dans la spl
	 *
	 */
	static public function register()
	{
		spl_autoload_register(array(new self, 'autoload_prynlib'));
	}
	
	/**
	 * Fonction d'autoload
	 *
	 * @param string $class_name
	 */
	static public function autoload_prynlib($class_name)
	{
		$include = '';		
		$include = ROOT_LIB.str_replace('_','/',$class_name).'.class.php';
		if(is_readable($include))
			require($include);
	}
}
 ?>